#include <stdio.h>

char first_not_repeat_char (const char * str)
{
    int hashtable[256] = { 0 };
    const char *p = str;

    while (*p) {
        hashtable[*p++]++;
    }

    p = str;
    while (*p) {
        if (hashtable[*p] == 1) {
            return *p;
        }
        p++;
    }
    return 0;
}

int main(int argc, char *argv[])
{
    char *p = "abaccdeff";

    printf("The first not-repeating char is %c\n", first_not_repeat_char(p));
    
    return 0;
}



